import 'babel-polyfill';
import Vue from 'vue';
import App from './App';
import router from './router';
import store from './store';
import './common/js/flexible-0.3.2.js';
import fastclick from 'fastclick';
import VueAwesomeSwiper from 'vue-awesome-swiper';
// require styles
import 'animate.css';
import 'swiper/dist/css/swiper.css';
import 'common/stylus/index.styl';
import MetaInfo from 'vue-meta-info';

const vueAnimate = require('./common/js/vue-animate');

Vue.use(VueAwesomeSwiper);
Vue.use(vueAnimate);
Vue.use(MetaInfo);

/* eslint-disable no-unused-vars */
// import vConsole from 'vconsole'

fastclick.attach(document.body);

router.afterEach((to, from, next) => {
    window.scrollTo(0, 0);
});

router.afterEach((to, from, next) => {
    window.scrollTo(0, 0);
});

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App),
    /* 这句非常重要，否则预渲染将不会启动 */
    mounted() {
        document.dispatchEvent(new Event('render-event'));
    }
});
